package com.jifujun.junbatis.base.model;

import lombok.ToString;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.util.Date;

/**
 * Create with IntelliJ IDEA
 * Project Name: junbatis
 * Package Name: club.emergency.junbatis.base
 * Date: 2018/3/29 14:29
 * User: 快乐的小菌菌
 * Description:
 */
@Slf4j
@ToString
public class RootObject implements Serializable {
    private Integer id;
    private Integer usingType;
    private Date createTime;
    private Date modifyTime;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getUsingType() {
        return usingType;
    }

    public void setUsingType(Integer usingType) {
        this.usingType = usingType;
    }

    public Date getCreateTime() {
        if (id == null) {
            createTime = new Date();
            return createTime;
        }
        return null;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getModifyTime() {
        if (id == null)
            return this.modifyTime = createTime;
        else
            return modifyTime = new Date();
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }
}
